function foo() {
  var a = b = 10
  //var a = 10
  //b = 10
}

foo()
//console.log(a);//报错 ReferenceError: a is not defined
console.log(b);//10
